﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T.FAS.Runtime.DataAccess.SQLDom
{
    /// <summary>
    /// 查询过滤条件
    /// </summary>
    [Serializable]
    public class GroupByClause
    { 
        /// <summary>
        /// 分组指定的列
        /// </summary>
        public FilterField FilterField { get; set; }

        /// <summary>
        /// 该分组列是否在结果列表中展示
        /// </summary>
        public bool IsShowInSelectList { get; set; }

        private string alias = string.Empty;

        /// <summary>
        /// 如果分组列展示在select查询结果中时应用的别名
        /// </summary>
        public string Alias
        {
            get
            {
                if (string.IsNullOrEmpty(alias))
                    alias = "GroupBy_" + FilterField.Field;
                return alias;
            }
        }
    } 
}
